package com.dragee.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 *
 */
@Component
@ConfigurationProperties(prefix = "webull")
public class BeautyConfig
{
//    /** 项目名称 */
//    private String name;
//
//    /** 版本 */
//    private String version;
//
//    /** 版权年份 */
//    private String copyrightYear;
//
//    /** 实例演示开关 */
//    private boolean demoEnabled;

    /** 上传路径 */
    private static String mapUploadPath;

//    /** 获取地址开关 */
//    private static boolean addressEnabled;
//
//    /** 验证码类型 */
//    private static String captchaType;


    public static String getMapUploadPath() {
        return mapUploadPath;
    }
//   set方法使用static修改 get方法无法获取值
    public  void setMapUploadPath(String mapUploadPath) {
        BeautyConfig.mapUploadPath = mapUploadPath;
    }

    public void setProfile(String profile)
    {
        BeautyConfig.mapUploadPath = profile;
    }


    /**
     * 获取导入上传路径
     */
    public static String getImportPath()
    {
        return getMapUploadPath() + "/import";
    }

    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath()
    {
        return getMapUploadPath() + "/avatar";
    }

    /**
     * 获取下载路径
     */
    public static String getDownloadPath()
    {
        return getMapUploadPath() + "/download/";
    }

    /**
     * 获取上传路径
     */
    public static String getUploadPath()
    {
        return getMapUploadPath() + "/upload";
    }
}
